Skip to content

Add cache clearing for created channels on buffer disconnection - #21

Merged
kabanaty merged 2 commits into
slaclab:masterfrom
kabanaty:master
Jun 17, 2026
Merged

Add cache clearing for created channels on buffer disconnection#21
kabanaty merged 2 commits into
slaclab:masterfrom
kabanaty:master

Conversation

@kabanaty

Copy link
Copy Markdown

This pull request updates the way channel access resources are cleaned up when disconnecting (PVs) in the slac_timing/buffer.py module. Instead of relying on Python's garbage collection, it now explicitly clears related channels from the CA cache, ensuring more reliable resource cleanup.

Resource management improvements:

  • Removed the use of gc.collect() in the _disconnect_pvs method and replaced it with a new _clear_ca_cache method that explicitly removes caget-created channels for the buffer from the CA cache and clears their channels using epics.ca.clear_channel.
  • Removed the unused gc import from the top of the file.

@kabanaty
kabanaty merged commit d3aa564 into slaclab:master Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant